<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../../../resources/js-test.js"></script>
<script src="test.js"></script>
<script src="../../xpath-test-pre.js"></script>
</head>
<body>
<div id="console"></div>

<script>
    result = DOM.evaluate("self::node()[true() and false()][true()]", ROOT, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
    checkSnapshot("self::node()[true() and false()][true()]", result, []);

    result = DOM.evaluate("self::node()[true() or false()][true()]", ROOT, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
    checkSnapshot("self::node()[true() or false()][true()]", result, [ROOT]);

    dom2 = (new DOMParser).parseFromString(
        "<?xml version='1.0'?>" +
        "<elementList>" +
        "    <element>" +
        "        <x>" +
        "           <y>a</y>" +
        "        </x>" +
        "    </element>" +
        "    <element>" +
        "        <x>" +
        "            <y>z</y>" +
        "        </x>" +
        "    </element>" +
        "</elementList>",
        "application/xml");

    result = dom2.evaluate("//element[descendant::y[.='z']]", dom2, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
    checkSnapshot("//element[descendant::y[.='z']]", result, [dom2.getElementsByTagName("element")[1]]);

    result = dom2.evaluate("//element[descendant::y[.='z']][1]", dom2, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
    checkSnapshot("//element[descendant::y[.='z']][1]", result, [dom2.getElementsByTagName("element")[1]]);

    result = dom2.evaluate("//element[descendant::y[.='z']][2]", dom2, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
    checkSnapshot("//element[descendant::y[.='z']][2]", result, []);

</script>
</body>
</html>
